using System;
using Headsight.BPMN2WF.BPMN.BlockModel;
using Headsight.BPMN2WF.BPMN.Model;
using Headsight.BPMN2WF.BPMN.Schemas;
using Headsight.BPMN2WF.Testing;
using Headsight.BPMN2WF.Testing.TestObjCtors;
using Headsight.BPMN2WF.WF.Activities;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Headsight.BPMN2WF.Transformation.Transformers
{
    [TestClass]
    public class BPMN2WFTransformation_DummyActivityTest
    {
        private BPMNFlowNode _bpmnFlowNode;
        private BPMN2WFTranformationTester _tester;
        private BPMN2WFTransformations4TestingCtor _bpmn2WfTransMappingsCtor;

        [TestInitialize]
        public void SetUp()
        {
            var bpmnFlowNode = new BPMNFlowNodeCtor().WithTFlowElement(new tUserTask()).WithId("**id1**").Create();
            _bpmnFlowNode = new BPMNFlowNodesBlockEmpty("**id1**", bpmnFlowNode);

            _bpmn2WfTransMappingsCtor = new BPMN2WFTransformations4TestingCtor()
                .WithDefault(typeof(BPMN2WFTransformationDummyActivity));

            _tester = new BPMN2WFTranformationTester().With(_bpmn2WfTransMappingsCtor).Create();
        }

        [TestMethod]
        public void Transform_and_verf_real_workflow_behavior()
        {
            var actual = _tester.Transform(_bpmnFlowNode).Execute();

            Assert.AreEqual(String.Empty, actual.ToString());
        }

        [TestMethod]
        public void Transform()
        {
            var actual = _tester.Transform(_bpmnFlowNode).BPMNTransformationResult;

            Assert.IsInstanceOfType(actual.Result, typeof(DummyActivity));
            Assert.AreSame(actual.Result, actual.FlowIn);
            Assert.AreSame(actual.Result, actual.FlowOut);
        }
    }
}